package com.haredot.entity;

import java.security.Principal;

/**
 * 处理 AccessToken, 并返回 ID, username
 */
public class UserPrincipal implements Principal {

    private Long id ;

    private String username ;

    public UserPrincipal(Long id, String username) {
        this.id = id;
        this.username = username;
    }

    @Override
    public String getName() {
        return username;
    }

    public Long getId() {
        return id;
    }
}
